home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_07 / allison / addborl.h < prev    next >
C/C++ Source or Header  |  1994-05-02  |  720b  |  37 lines

  1. LISTING 6 - Additional code to make Borland's <except.h> header
  2. standard-conforming
  3.  
  4. // Standard exceptions (CDA, 4/21/94)
  5. #define exception xmsg
  6. #define alloc xalloc
  7. #define what why
  8.  
  9. class logic : public exception
  10. {
  11. public:
  12.     logic(const string& msg) : exception(msg) {}
  13.     void raise() {throw *this;}
  14. };
  15.  
  16. class domain : public logic
  17. {
  18. public:
  19.     domain(const string& msg) : logic(msg) {}
  20.     void raise() {throw *this;}
  21. };
  22.  
  23. class runtime : public exception
  24. {
  25. public:
  26.     runtime(const string& msg) : exception(msg) {}
  27.     void raise() {throw *this;}
  28. };
  29.  
  30. class range : public runtime
  31. {
  32. public:
  33.     range(const string & msg) : runtime(msg) {}
  34.     void raise() {throw *this;}
  35. };
  36.  
  37.